package com.innjia.base.utils.pdf;

import java.io.File;
import java.io.IOException;

import com.innjia.base.common.Config;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.BaseFont;

public class CustomFont {
	
    private static String fontPath = Config.getFileStore();
    
    /**
     * 获取默认字体
     * @return 返回 BaseFont
     * @throws DocumentException
     * @throws IOException
     */
    public static BaseFont getDefaultFont() throws DocumentException, IOException{
        return BaseFont.createFont(fontPath + File.separator + "simsun.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
    }

    /**
     *  获取段宁毛笔行书
     * @return 返回 BaseFont
     * @throws DocumentException
     * @throws IOException
     */
    public static BaseFont getDnmbxsFont() throws DocumentException, IOException{
        return BaseFont.createFont(fontPath + File.separator + "dnmbxs.ttf", BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
    }

    /**
     *  获取李旭科书法
     * @return  BaseFont
     * @throws DocumentException
     * @throws IOException
     */
    public static BaseFont getLxksfFont() throws DocumentException, IOException{
        return BaseFont.createFont(fontPath + File.separator + "lxksf.ttf", BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
    }

    /**
     *  获取李旭科毛笔行书
     * @return BaseFont
     * @throws DocumentException
     * @throws IOException
     */
    public static BaseFont getLxkmbxsFont() throws DocumentException, IOException{
        return BaseFont.createFont(fontPath + File.separator + "lxkmbxs.ttf", BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
    }
    /**
     *  获取华文新魏
     * @return BaseFont
     * @throws DocumentException
     * @throws IOException
     */
    public static BaseFont getHwxwFont() throws DocumentException, IOException{
        return BaseFont.createFont(fontPath + File.separator + "hwxw.ttf", BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
    }

}
